package com.cms.common.model.entity;

import com.cms.common.utils.TranslateUtil;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * 文章分类
 */
@Entity
@Data
public class ArticleCategory extends BaseEntity {

    @OneToMany(targetEntity = Translate.class, cascade = {CascadeType.ALL})
    private List<Translate> nameTranslates = null;//

    @Transient
    private Translate nameTranslate = null;//

    public Translate getNameTranslate() {
        return TranslateUtil.getContentTranslate(nameTranslates);
    }
}
